%{
#include <iostream>
#include <stdio.h>
#include "main.hpp"
#define YYDEBUG 0
extern "C" {
void yyerror(const char *s);
extern int yylex(void);
}
int num = 0;
int num1 = 0;
char *g_word = NULL;
%}
%token HEADERFILE HEADERFILE1
%%
program:
	{
		printf("xxx g_word %s \r\n", g_word);
	}
	|include_preprocess 
	;
include_preprocess:
	HEADERFILE
	{
		printf("000 #include %s \r\n", g_word);
		num++;
	}
	| HEADERFILE1
	{
		printf("111 #include %s \r\n", g_word);
		num1++;
	}
%%
void yyerror(const char *s)
{
	//std::cerr<<s<<std::endl;
}

extern FILE *yyin;
int main()
{
#if YYDEBUG
	yydebug = 1;
#endif	
	do {
		yyparse();
	}while(!feof(yyin));
	printf("get num=%d num1=%d\r\n", num, num1);
	
	return 0;
}
